<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>键盘事件处理</title>
</head>
<body>
<div id="app">
  <input type="text" v-on:keyup.enter="onKey" id="wd">
  <br>
  <input type="text" v-on:keyup="onTest" v-model="content">
</div>
<script src="../../../../js/vue.global.js"></script>

<script>
  const app = Vue.createApp({
    data(){
      return {
        content:null,
      }
    },

    methods:{
      onKey(){
        // console.log("abcd");
        let element = document.getElementById("wd")
        console.log(element.value);

      },
      onTest(){

        console.log(this.content);
      }
    }
  })

  app.mount("#app")
</script>
</body>
</html>